package com.sky.mapper.admin;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.AutoFill;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper extends BaseMapper<Setmeal> {

    @Select("select count(id) from sky_take_out.setmeal where category_id = #{categoryId}")
    int findSetmealCountByCategoryId(Long categoryId);

    List<SetmealVO> getSetmealByPage(SetmealPageQueryDTO dto);

//    @AutoFill(OperationType.INSERT)
    int addSetmeal(Setmeal setmeal);

    SetmealVO getSetmealAllInfoById(Long id);

    @AutoFill(OperationType.UPDATE)
    int updateSetmeal(Setmeal setmeal);

    List<Setmeal> getEnableSetmealCountByIds(List<Long> idList);


    int deleteSetmealByIds(List<Long> idList);

    List<Setmeal> getSetmealByCategoryId(Long categoryId);
}
